﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace StringConvertDemo
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //int t=Convert.ToInt32( this.TextBox1.Text);
            int i;
            bool isSuccessful= int.TryParse(this.TextBox1.Text,out i);
            if (isSuccessful == true)
            {
                this.Button1.Text = "Ok";
            }
            else
            {
                this.Button1.Text = "Error";
            }
        }
    }
}